{% load static %}
{% load set_val %}
<link rel="stylesheet" type="text/css" href="{% static 'css/form.css' %}"/>

<h1>流程配置 |&nbsp;&nbsp;{{ contractname }}</h1>

<div class="allocation_contract">
    <div class="countersign_contract_person">
        <div class="distribution">
            <div>分配会签人</div>
            <div>待分配人员列表</div>
            <select class="countersign" id="countersign_will" size="5"
                    onChange="onDeleteCountersignWillOption(this.value)">
                {% for userright in left1_rightlist %}
                    {% if contractState < 2 %}
                        <option value="{{ userright.username.username }}">{{ userright.username.username }}</option>#}
                    {% else %}
                        <option value="{{ userright.username.username }}" disabled="disabled">{{ userright.username.username }}</option>#}
                    {% endif %}

                {% endfor %}
            </select>
        </div>
        <div class="distribution">
            <div class="had">已分配人员列表</div>
            <select class="countersign" id="countersign_have" size="5"
                    onChange="onDeleteCountersignHaveOption(this.value)">
                {% for countersignprocess in countersign %}
                    {% if countersignprocess.state == 0 %}
                        <option value="{{ countersignprocess.username.username }}">{{ countersignprocess.username.username }}</option>
                    {% else %}
                        <option value="{{ countersignprocess.username.username }}" disabled="disabled">{{ countersignprocess.username.username }}</option>
                    {% endif %}

                {% endfor %}
            </select>
        </div>
    </div>

    <div class="approve_contract_person">
        <div class="distribution">
            <div>分配审批人</div>
            <div>待分配人员列表</div>
            <select class="approve" id="approve_will" size="5" onChange="onDeleteApproveWillOption(this.value)">
                {% for userright in left2_rightlist %}
                    {% if contractState < 4 %}
                        <option value="{{ userright.username.username }}">{{ userright.username.username }}</option>#}
                    {% else %}
                        <option value="{{ userright.username.username }}" disabled="disabled">{{ userright.username.username }}</option>#}
                    {% endif %}
                {% endfor %}
            </select>
        </div>
        <div class="distribution">
            <div class="had">已分配人员列表</div>
            <select class="approve" id="approve_have" size="5" onChange="onDeleteApproveHaveOption(this.value)">
                {% for approveprocess in approve %}
                    {% if approveprocess.state == 0 %}
                        <option value="{{ approveprocess.username.username }}">{{ approveprocess.username.username }}</option>
                    {% else %}
                        <option value="{{ approveprocess.username.username }}" disabled="disabled">{{ approveprocess.username.username }}</option>
                    {% endif %}
{#                    <option value="{{ approveprocess.username.username }}">{{ approveprocess.username.username }}</option>#}
                {% endfor %}
            </select>
        </div>
    </div>

    <div class="sign_contract_person">
        <div class="distribution">
            <div>分配签订人</div>
            <div>待分配人员列表</div>
            <select class="sign" id="sign_will" size="5" onChange="onDeleteSignWillOption(this.value)">
                {% for userright in left3_rightlist %}
                    {% if contractState < 5 %}
                        <option value="{{ userright.username.username }}">{{ userright.username.username }}</option>#}
                    {% else %}
                        <option value="{{ userright.username.username }}" disabled="disabled">{{ userright.username.username }}</option>#}
                    {% endif %}
                {% endfor %}
            </select>
        </div>
        <div class="distribution">
            <div class="had">已分配人员列表</div>
            <select class="sign" id="sign_have" size="5" onChange="onDeleteSignHaveOption(this.value)">
                {% for signprocess in sign %}
                    {% if signprocess.state == 0 %}
                        <option value="{{ signprocess.username.username }}">{{ signprocess.username.username }}</option>
                    {% else %}
                        <option value="{{ signprocess.username.username }}" disabled="disabled">{{ signprocess.username.username }}</option>
                    {% endif %}
{#                    <option value="{{ signprocess.username.username }}">{{ signprocess.username.username }}</option>#}
                {% endfor %}
            </select>
        </div>
    </div>
    <div class="btn">
        <button onclick="onAllocationCommit('{{ conid }}')">提交</button>
        <button onclick="onReturnPrePage()">取消</button>
    </div>
</div>
